<template>
  <div>
     <el-breadcrumb separator="/">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-table :data="rightList" border stripe>
        <el-table-column label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column label="权限名称" prop="authName" min-width="20%">
        </el-table-column>
        <el-table-column label="路径" prop="path" min-width="20%">
        </el-table-column>
        <el-table-column label="权限等级" prop="level" min-width="20%">
          <template v-slot="scope">
            <el-tag v-if="scope.row.level == 0">一级权限</el-tag>
            <el-tag type="success" v-else-if="scope.row.level == 1">二级权限</el-tag>
            <el-tag type="warning" v-else-if="scope.row.level == 2">三级权限</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
import {getRights} from "../../../api/right"
export default {

  created(){
    this.getRightList()
  },
  data(){
    return {
      rightList:[]
    }
  },
  methods:{
    async getRightList(){
      try {
        const res = await getRights('list')
        this.rightList = res.data
      } catch (err) {
        console.log(err);
      }
    }
  }
  
}
</script>
<style scoped>
</style>